/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2013
 */

package com.smg.community.model;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.apache.commons.lang.time.DateUtils;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.smg.community.model.*;
import com.smg.community.dao.*;
import com.smg.community.service.*;
import com.smg.community.vo.query.*;

/**
 * @author badqiu email:badqiu(a)gmail.com
 * @version 1.0
 * @since 1.0
 */


public class SmgTopic extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	public static final String FORMAT_CREATE_DATE = DATE_TIME_FORMAT;
	public static final String FORMAT_LAST_REPLY_DATE = DATE_FORMAT;
	public static final String FORMAT_LAST_OPERATE_DATE = DATE_FORMAT;
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 涓婚敭ID       db_column: topicId 
     */	
	
	private java.lang.Integer topicId;
    /**
     */	
	private java.lang.Integer fkGroupId;
    /**
     */	
	private java.lang.String groupName;
    /**
     * 鎵�湪缇ょ粍鎵�睘鐨勫垎绫籌D       db_column: fkCateId 
     */	
	private java.lang.Integer fkCateId;
    /**
     * 鍐椾綑鐨勫垎绫诲悕绉�       db_column: cateName 
     */	
	private java.lang.String cateName;
    /**
     * 鏍囬閫夋嫨鐨勭被鍨媔d锛屼緥濡�鍘熷垱,璧勬枡绛夌瓑 鍏宠仈smg_title_type琛�       db_column: fkTitleTypeId 
     */	
	private java.lang.Integer fkTitleTypeId;
    /**
     * 鍐椾綑鐨勬爣棰橀�鎷╃殑鍒嗙被鍚嶇О       db_column: titleTypeName 
     */	
	private java.lang.String titleTypeName;
    /**
     * 鍒涘缓鑰呯殑鐢ㄦ埛ID       db_column: fkCreateMemberId 
     */	
	private java.lang.Integer fkCreateMemberId;
    /**
     * 鍒涘缓鑰呯殑鏄电О       db_column: createMemberName 
     */	
	private java.lang.String createMemberName;
    /**
     * 鍒涘缓鑰呯殑澶村儚       db_column: createMemberHead 
     */	
	private java.lang.String createMemberHead;
    /**
     * 鍒涘缓鏃ユ湡       db_column: createDate 
     */	
	private java.util.Date createDate;
    /**
     * 鏈�悗涓�鍥炲鏃ユ湡       db_column: lastReplyDate 
     */	
	
	private java.util.Date lastReplyDate;
    /**
     * 鏈�悗涓�鍥炲鐢ㄦ埛ID       db_column: lastReplyMemberId 
     */	
	
	private java.lang.Integer lastReplyMemberId;
    /**
     * 鏈�悗涓�鍥炲鐢ㄦ埛鍚�       db_column: lastReplyMemberName 
     */	
	private java.lang.String lastReplyMemberName;
    /**
     * 杩囨护鍓嶇敤鎴峰彂琛ㄧ殑鍘熷鍐呭       db_column: topicContBeforeFilter 
     */	
	private java.lang.String topicContBeforeFilter;
    /**
     * 杩囨护鍚庣殑鍐呭锛岃繖涓唴瀹规樉绀哄湪椤甸潰涓�       db_column: topicContAfterFilter 
     */	
	private java.lang.String topicContAfterFilter;
    /**
     * 鏄惁鍖呭惈鍏抽敭瀛�1-鏄�0-鍚�       db_column: isTopicContainKeyWord 
     */	
	
	private java.lang.Integer isTopicContainKeyWord;
    /**
     * 鍖呭惈鐨勫叧閿瓧       db_column: topicContainKeyWords 
     */	
	private java.lang.String topicContainKeyWords;
    /**
     * 鏄惁绮惧崕       db_column: isEssence 
     */	
	private java.lang.Integer isEssence;
    /**
     * 鏄惁鎺ㄨ崘       db_column: isRecommend 
     */	
	private java.lang.Integer isRecommend;
    /**
     * 鎿嶄綔鏃ュ織       db_column: operateLog 
     */	
	private java.lang.String operateLog;
    /**
     * 鏈�悗涓�鐨勬搷浣滄棩蹇�       db_column: lastOperateLog 
     */	
	private java.lang.String lastOperateLog;
    /**
     * 鏈�悗涓�鐨勬搷浣滄棩鏈�       db_column: lastOperateDate 
     */	
	
	private java.util.Date lastOperateDate;
    /**
     * 鏄惁鏈夋晥 1-鏈夋晥       db_column: isValid 
     */	
	private java.lang.Integer isValid;
    /**
     * 鐐瑰嚮鏁�       db_column: clickCount 
     */	
	private java.lang.Integer clickCount;
    /**
     * 鍥炲鏁�       db_column: replyCount 
     */	
	private java.lang.Integer replyCount;
    /**
     * 绫诲瀷 1 - 普通 2 - 活动  3 - 投票 エ       db_column: topicType 
     */	
	private java.lang.Integer topicType;
    /**
     * 涓婚鎵�睘鐨勫煄甯�       db_column: cityNo 
     */	
	
	private java.lang.Integer cityNo;
    /**
     * 鍐椾綑鐨勫煄甯傚悕绉�       db_column: cityName 
     */	
	private java.lang.String cityName;
	//columns END
	private String topicTitleBeforeFilter;
	
	private String topicTitleAfterFilter;
	
	
	private String groupImage;
	
	
	private String picview;
	
	private String pivciew203;
	
	private int isTodayTopic;

	private int praiseCount;
	
	public int getPraiseCount() {
		return praiseCount;
	}

	public void setPraiseCount(int praiseCount) {
		this.praiseCount = praiseCount;
	}

	public int getIsTodayTopic() {
		if ( DateUtils.isSameDay(getCreateDate(),new Date())){
			isTodayTopic = 1;
		}else{
			isTodayTopic = 0;
		}
		return isTodayTopic;
	}

	public void setIsTodayTopic(int isTodayTopic) {
		this.isTodayTopic = isTodayTopic;
	}

	public String getPivciew203() {
		if ( picview == null){
			pivciew203 = "http://img3.ddmapimg.com/crm//2013-05-14/233710921.jpg";
		}else{
			pivciew203 = picview;
		}
		return pivciew203;
	}

	public void setPivciew203(String pivciew203) {
		this.pivciew203 = pivciew203;
	}

	public String getPicview() {
		if ( picview == null){
			return  "http://img3.ddmapimg.com/crm//2013-05-14/233656344.jpg";
		}
		return picview;
	}

	public void setPicview(String picview) {
		this.picview = picview;
	}


	/**
	 * 置顶类型
	 * 3 - 全站置顶
	 * 2 - 分类置顶
	 * 1 - 组内置顶
	   0 - 普通帖
	 */
	private int topType;
	
	 /**
     * startDate       db_column: startDate 
     */	
	private java.util.Date startDate;
    /**
     * endDate       db_column: endDate 
     */	
	private java.util.Date endDate;
    /**
     * 1-free 2-charge 3-needzhengnengliang       db_column: activityType 
     */	
	
	private java.lang.Integer activityType;
    /**
     * point       db_column: point 
     */	
	
	private java.lang.Integer point;
	
	
	public java.util.Date getStartDate() {
		if ( startDate == null)
				return new Date();
		return startDate;
	}

	public void setStartDate(java.util.Date startDate) {
		this.startDate = startDate;
	}

	public java.util.Date getEndDate() {
		if (endDate == null){
			return new Date();
		}
		return endDate;
	}

	public void setEndDate(java.util.Date endDate) {
		this.endDate = endDate;
	}

	public java.lang.Integer getActivityType() {
		return activityType;
	}

	public void setActivityType(java.lang.Integer activityType) {
		this.activityType = activityType;
	}

	public java.lang.Integer getPoint() {
		return point;
	}

	public void setPoint(java.lang.Integer point) {
		this.point = point;
	}

	public String getGroupImage() {
		if ( groupImage == null || groupImage.trim().equals("") )
			groupImage =  "http://img3.ddmapimg.com/crm//2013-04-26/225831802.jpg";
		return groupImage;
	}

	
	private int jionActivityMemberCount ;
	public int getJionActivityMemberCount() {
		return jionActivityMemberCount;
	}

	public void setJionActivityMemberCount(int jionActivityMemberCount) {
		this.jionActivityMemberCount = jionActivityMemberCount;
	}

	public void setGroupImage(String groupImage) {
		this.groupImage = groupImage;
	}

	public int getTopType() {
		return topType;
	}

	public void setTopType(int topType) {
		this.topType = topType;
	}

	public String getTopicTitleBeforeFilter() {
		return topicTitleBeforeFilter;
	}

	public void setTopicTitleBeforeFilter(String topicTitleBeforeFilter) {
		this.topicTitleBeforeFilter = topicTitleBeforeFilter;
	}

	public String getTopicTitleAfterFilter() {
		return topicTitleAfterFilter;
	}

	public void setTopicTitleAfterFilter(String topicTitleAfterFilter) {
		this.topicTitleAfterFilter = topicTitleAfterFilter;
	}

	public SmgTopic(){
	}

	public SmgTopic(
		java.lang.Integer topicId
	){
		this.topicId = topicId;
	}

	public void setTopicId(java.lang.Integer value) {
		this.topicId = value;
	}
	
	public java.lang.Integer getTopicId() {
		return this.topicId;
	}
	public void setFkGroupId(java.lang.Integer value) {
		this.fkGroupId = value;
	}
	
	public java.lang.Integer getFkGroupId() {
		return this.fkGroupId;
	}
	public void setGroupName(java.lang.String value) {
		this.groupName = value;
	}
	
	public java.lang.String getGroupName() {
		return this.groupName;
	}
	public void setFkCateId(java.lang.Integer value) {
		this.fkCateId = value;
	}
	
	public java.lang.Integer getFkCateId() {
		return this.fkCateId;
	}
	public void setCateName(java.lang.String value) {
		this.cateName = value;
	}
	
	public java.lang.String getCateName() {
		return this.cateName;
	}
	public void setFkTitleTypeId(java.lang.Integer value) {
		this.fkTitleTypeId = value;
	}
	
	public java.lang.Integer getFkTitleTypeId() {
		return this.fkTitleTypeId;
	}
	public void setTitleTypeName(java.lang.String value) {
		this.titleTypeName = value;
	}
	
	public java.lang.String getTitleTypeName() {
		return this.titleTypeName;
	}
	public void setFkCreateMemberId(java.lang.Integer value) {
		this.fkCreateMemberId = value;
	}
	
	public java.lang.Integer getFkCreateMemberId() {
		return this.fkCreateMemberId;
	}
	public void setCreateMemberName(java.lang.String value) {
		this.createMemberName = value;
	}
	
	public java.lang.String getCreateMemberName() {
		return this.createMemberName;
	}
	public void setCreateMemberHead(java.lang.String value) {
		this.createMemberHead = value;
	}
	
	public java.lang.String getCreateMemberHead() {
		if  ( createMemberHead == null || createMemberHead.trim().equals("")){
			createMemberHead = "http://img3.ddmapimg.com/crm/2013-04-26/224956577.jpg";
		}
		return this.createMemberHead;
	}
	public String getCreateDateString() {
		return DateConvertUtils.format(getCreateDate(), FORMAT_CREATE_DATE);
	}
	public String getStartDateString() {
		return DateConvertUtils.format(getStartDate(), FORMAT_CREATE_DATE);
	}
	
	public String getEndDateString() {
		return DateConvertUtils.format(getEndDate(), FORMAT_CREATE_DATE);
	}
	public void setCreateDate(java.util.Date value) {
		this.createDate = value;
	}
	
	public java.util.Date getCreateDate() {
		return this.createDate;
	}
	public String getLastReplyDateString() {
		return DateConvertUtils.format(getLastReplyDate(), FORMAT_LAST_REPLY_DATE);
	}
	public void setLastReplyDateString(String value) {
		setLastReplyDate(DateConvertUtils.parse(value, FORMAT_LAST_REPLY_DATE,java.util.Date.class));
	}
	
	public void setLastReplyDate(java.util.Date value) {
		this.lastReplyDate = value;
	}
	
	public java.util.Date getLastReplyDate() {
		return this.lastReplyDate;
	}
	public void setLastReplyMemberId(java.lang.Integer value) {
		this.lastReplyMemberId = value;
	}
	
	public java.lang.Integer getLastReplyMemberId() {
		return this.lastReplyMemberId;
	}
	public void setLastReplyMemberName(java.lang.String value) {
		this.lastReplyMemberName = value;
	}
	
	public java.lang.String getLastReplyMemberName() {
		return this.lastReplyMemberName;
	}
	public void setTopicContBeforeFilter(java.lang.String value) {
		this.topicContBeforeFilter = value;
	}
	
	public java.lang.String getTopicContBeforeFilter() {
		return this.topicContBeforeFilter;
	}
	public void setTopicContAfterFilter(java.lang.String value) {
		this.topicContAfterFilter = value;
	}
	
	public java.lang.String getTopicContAfterFilter() {
		return this.topicContAfterFilter;
	}
	public void setIsTopicContainKeyWord(java.lang.Integer value) {
		this.isTopicContainKeyWord = value;
	}
	
	public java.lang.Integer getIsTopicContainKeyWord() {
		return this.isTopicContainKeyWord;
	}
	public void setTopicContainKeyWords(java.lang.String value) {
		this.topicContainKeyWords = value;
	}
	
	public java.lang.String getTopicContainKeyWords() {
		return this.topicContainKeyWords;
	}
	public void setIsEssence(java.lang.Integer value) {
		this.isEssence = value;
	}
	
	public java.lang.Integer getIsEssence() {
		return this.isEssence;
	}
	public void setIsRecommend(java.lang.Integer value) {
		this.isRecommend = value;
	}
	
	public java.lang.Integer getIsRecommend() {
		return this.isRecommend;
	}
	public void setOperateLog(java.lang.String value) {
		this.operateLog = value;
	}
	
	public java.lang.String getOperateLog() {
		return this.operateLog;
	}
	public void setLastOperateLog(java.lang.String value) {
		this.lastOperateLog = value;
	}
	
	public java.lang.String getLastOperateLog() {
		return this.lastOperateLog;
	}
	public String getLastOperateDateString() {
		return DateConvertUtils.format(getLastOperateDate(), FORMAT_LAST_OPERATE_DATE);
	}
	public void setLastOperateDateString(String value) {
		setLastOperateDate(DateConvertUtils.parse(value, FORMAT_LAST_OPERATE_DATE,java.util.Date.class));
	}
	
	public void setLastOperateDate(java.util.Date value) {
		this.lastOperateDate = value;
	}
	
	public java.util.Date getLastOperateDate() {
		return this.lastOperateDate;
	}
	public void setIsValid(java.lang.Integer value) {
		this.isValid = value;
	}
	
	public java.lang.Integer getIsValid() {
		return this.isValid;
	}
	public void setClickCount(java.lang.Integer value) {
		this.clickCount = value;
	}
	
	public java.lang.Integer getClickCount() {
		return this.clickCount;
	}
	public void setReplyCount(java.lang.Integer value) {
		this.replyCount = value;
	}
	
	public java.lang.Integer getReplyCount() {
		return this.replyCount;
	}
	public void setTopicType(java.lang.Integer value) {
		this.topicType = value;
	}
	
	public java.lang.Integer getTopicType() {
		return this.topicType;
	}
	public void setCityNo(java.lang.Integer value) {
		this.cityNo = value;
	}
	
	public java.lang.Integer getCityNo() {
		return this.cityNo;
	}
	public void setCityName(java.lang.String value) {
		this.cityName = value;
	}
	
	public java.lang.String getCityName() {
		return this.cityName;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("TopicId",getTopicId())
			.append("FkGroupId",getFkGroupId())
			.append("GroupName",getGroupName())
			.append("FkCateId",getFkCateId())
			.append("CateName",getCateName())
			.append("FkTitleTypeId",getFkTitleTypeId())
			.append("TitleTypeName",getTitleTypeName())
			.append("FkCreateMemberId",getFkCreateMemberId())
			.append("CreateMemberName",getCreateMemberName())
			.append("CreateMemberHead",getCreateMemberHead())
			.append("CreateDate",getCreateDate())
			.append("LastReplyDate",getLastReplyDate())
			.append("LastReplyMemberId",getLastReplyMemberId())
			.append("LastReplyMemberName",getLastReplyMemberName())
			.append("TopicContBeforeFilter",getTopicContBeforeFilter())
			.append("TopicContAfterFilter",getTopicContAfterFilter())
			.append("IsTopicContainKeyWord",getIsTopicContainKeyWord())
			.append("TopicContainKeyWords",getTopicContainKeyWords())
			.append("IsEssence",getIsEssence())
			.append("IsRecommend",getIsRecommend())
			.append("OperateLog",getOperateLog())
			.append("LastOperateLog",getLastOperateLog())
			.append("LastOperateDate",getLastOperateDate())
			.append("IsValid",getIsValid())
			.append("ClickCount",getClickCount())
			.append("ReplyCount",getReplyCount())
			.append("TopicType",getTopicType())
			.append("CityNo",getCityNo())
			.append("CityName",getCityName())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getTopicId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof SmgTopic == false) return false;
		if(this == obj) return true;
		SmgTopic other = (SmgTopic)obj;
		return new EqualsBuilder()
			.append(getTopicId(),other.getTopicId())
			.isEquals();
	}
}

